package com.dnd.monitor.common.utils;

/**
 * @Author 安贺
 * @CreateTime 2022年08月10日 10:32:00
 * @Description:  文书号工具类
 */
public class DocNumUtil {


    public static String str2OnlyWordAndNum(String docNum){
        String regex = "[^a-zA-Z0-9\\u4E00-\\u9FA5]";
        return docNum.replaceAll(regex,"");
    }
    public static String symbol2Percent(String docNum){
        String regex = "[^a-zA-Z0-9\\u4E00-\\u9FA5]";
        String s = docNum.replaceAll(regex, "%");
        return "%"+s+"%";
    }

    public static void main(String[] args) {
        String str = "准字2022第168号";
        boolean contains = DocNumUtil.str2OnlyWordAndNum("(冀石新华税第一分局)准字〔2022〕第(168)号").contains(str);
        System.out.println(contains);
        System.out.println(DocNumUtil.str2OnlyWordAndNum("(冀石新华税第一分局)准字〔2022〕第(168)号"));
    }
}
